﻿using System;
using System.Collections.Generic;
using System.Text;
using NHibernate;
using NHibernate.Cfg;

namespace SNARF.Framework.ActiveRecord
{
    public abstract class SessionProviderBase
    {
        public abstract ISession  CurrentSession { get; }
        //void CloseSession();
        //void CloseSessionFactory();
        event EventHandler SessionClosing;

        private readonly ISessionFactory _sessionFactory;

        protected ISessionFactory sessionFactory { get { return _sessionFactory; } }

        public SessionProviderBase()
        {
            _sessionFactory = new Configuration().Configure().BuildSessionFactory();
        }
    }
}
